package com.example.util;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel("返回值封装")
public class Result implements Serializable {

    @ApiModelProperty("状态码")
    private Integer code; //状态码， 代表本次请求成功还是失败  1000010
    @ApiModelProperty("返回数据")
    private Object data; //数据，请求成功携带的数据
    @ApiModelProperty("返回的消息")
    private String msg; //消息说明。


    public Result() {
    }


    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result(Integer code, Object data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }
}
